Skip to content

test(node): pin task list limit ceiling and default on the cursor handler - #572

Merged
beardthelion merged 4 commits into
mainfrom
monexa/issue-399-62cdd3-takeover
Nov 10, 2026
Merged

beardthelion merged 4 commits into
mainfrom
monexa/issue-399-62cdd3-takeover

Conversation

@beardthelion

@beardthelion beardthelion commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Re-home of #405 (author: jialfaro), carried onto current main. The original clamp is already on main through the cursor-paginated list_tasks; this branch keeps the contributor history and adds the two regression pins main still lacks: the numeric ceiling (200) and the omitted-limit default (50).

Motivation & context

#399 reported that a negative limit on GET /api/v1/tasks returned 500 with a raw database error, and that the limit was unbounded. Both are already fixed on main: collect_visible_tasks clamps the requested limit to [0, 200] and negative-limit behavior is pinned by negative_limit_returns_empty. The residual value in the original PR is its test contract: explicit coverage that an over-ceiling limit returns at most 200 rows and that an omitted limit falls back to 50.

Kind of change

  • Test coverage
  • New commit(s) layered on a re-homed contributor branch (authorship preserved)

What changed

Contributor work (unchanged): the original clamp and tests written against the pre-cursor handler. The merge took main's side of tasks.rs wholesale, since the contributor's direct list_tasks clamp is superseded by collect_visible_tasks.

Maintainer commit:

  • limit_ceiling_caps_at_200: seeds 201 tasks, requests limit=9223372036854775807 (i64::MAX), asserts count == 200.
  • omitted_limit_uses_default_50: seeds 60 tasks, omits limit, asserts count == 50.

How a reviewer can verify

  • cargo test -p gitlawb-node --bin gitlawb-node api::tasks::visible_tasks_tests covers the two new pins plus negative_limit_returns_empty.
  • The clamp itself lives in collect_visible_tasks; this PR adds coverage, not behavior.

Before you request review

  • cargo fmt --all -- --check clean
  • cargo clippy --locked --workspace --all-targets -D warnings clean (pre-push gate ran on this head)
  • Focused task tests run and pass on this head
  • No secrets, credentials, or generated artifacts
  • Contributor commits preserved unmodified (no rebase/amend/squash)

Protocol & signing impact

None: tests only, no behavior change.

Notes for reviewers

The implementation half of #405 is redundant on current main; the merge took main's side and this branch's delta is the two pins. Negative-limit coverage stays with the existing negative_limit_returns_empty. Supersedes #405.

Summary by CodeRabbit

  • Tests
    • Added coverage confirming that task listings return no more than 200 rows for an extremely large limit, and return 50 rows when no limit is specified. These checks document the expected results for both limit-handling cases; no user-facing functionality changes are included.

jialfaro and others added 4 commits September 5, 2026 16:53
…dler

Port the #405 regression coverage onto the current cursor-paginated
handler: i64::MAX clamps to the 200 ceiling and an omitted limit falls
back to the 50-row default. Negative-limit behavior is already pinned
by negative_limit_returns_empty.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54c4c511-20ac-4383-9f70-a7ba372c881b
Commits

Reviewing files that changed from the base of the PR and between 66fe646 and 1f15542.

Files selected for processing: 1

  • crates/gitlawb-node/src/api/tasks.rs

No actionable comments were generated in the recent review.

Walkthrough

Added tests for list_tasks to check that a limit of i64::MAX returns 200 tasks and that omitting the limit returns the default 50 tasks.

Changes: Task list limit handling

Layer / File(s) Summary
Verify task list limit handling
crates/gitlawb-node/src/api/tasks.rs
Added tests that assert list_tasks returns 200 tasks for a limit of i64::MAX and 50 tasks when the limit is omitted.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Suggested labels: crate:node

Suggested reviewers: kevincodex1

Merge Risk: Minimal · up to 1f155

The change adds limit regression tests; no merge-blocking issue is identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the task-list limit ceiling and default tests on the cursor handler.
Description check Passed The description covers the change, motivation, test details, verification steps, review checks, and protocol impact. It provides enough information to review the test-only change.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 298c613d-3336-4d27-8f01-1ba24d20efda
Commits

Reviewing files that changed from the base of the PR and between 66fe646 and 1f15542.

Files selected for processing: 1

  • crates/gitlawb-node/src/api/tasks.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@beardthelion

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 55 minutes.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Thanks for the contribution. I do not see any actionable issues from my review.

Merge readiness

  • Supersedes #405: Close or link #405 when this lands so the duplicate open PR does not linger.
  • Checks: At review time, test (stable), test (beta), and Analyze (rust) were still pending; fmt + clippy, MSRV (Rust 1.91), and build --release had passed. Confirm the remaining required jobs are green before merge (GitHub mergeStateStatus was BLOCKED while those ran).
  • CodeRabbit: Reported skipping on this head; no actionable automated review to reconcile yet.

Notes (non-blocking)

The new pins assert count only. Module tests full_page_advertises_has_more_and_enumerates_past_the_row_cap already guard echoed limit and has_more for over-ceiling requests (limit=500). Optional follow-up — not required for this PR — would mirror the contributor’s tasks array length assertions from the original #405 tests or reuse MAX_VISIBLE_TASKS literals in assertions for drift resistance.

@beardthelion
beardthelion added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit af6a759 Nov 10, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants